#include <QtUrlEditorManager.h>


QtUrlEditorManager::QtUrlEditorManager(QObject *parent /*= 0*/ ) : QtAbstractPropertyManager(parent)
{

}

QtUrlEditorManager::~QtUrlEditorManager()
{

}

QUrl QtUrlEditorManager::value(QtProperty *property_ptr)
{
    if (!m_propertyPtrToData.contains(property_ptr))
        return "";
    return m_propertyPtrToData[property_ptr].value;

}

QString QtUrlEditorManager::filter(QtProperty *property_ptr)
{
    if (!m_propertyPtrToData.contains(property_ptr))
        return "";
    return m_propertyPtrToData[property_ptr].filter;

}

void QtUrlEditorManager::setValue(QtProperty *property_ptr, const QUrl &value_str)
{
    if (!m_propertyPtrToData.contains(property_ptr))
        return;
    m_propertyPtrToData[property_ptr].value = value_str;
    emit propertyChanged (property_ptr);
    emit valueChanged(property_ptr,value_str);
}

void QtUrlEditorManager::setFilter(QtProperty *property_ptr, const QString &filter_str)
{
    if (!m_propertyPtrToData.contains(property_ptr))
        return;
    m_propertyPtrToData[property_ptr].filter = filter_str;

}

void QtUrlEditorManager::initializeProperty(QtProperty *property)
{
    m_propertyPtrToData[property] = Data();
}

QString QtUrlEditorManager::valueText(const QtProperty *property) const
{
    if (!m_propertyPtrToData.contains(property))
        return "";
    return m_propertyPtrToData[property].value.toString();
}
#include "moc_QtUrlEditorManager.cxx"

